how to fix graphics error in c